package com.Thread;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86184
 * Date: 2023-11-09
 * Time: 10:48
 */
//public class Test2 {
//    public static void main(String[] args) {
//        MyThread myThread = new MyThread();
//        myThread.start();
//        System.out.println("999");
//    }
//}
//
//class MyThread extends Thread{
//    public void run(){
//        System.out.println("6666");
//    }
//}

public class Test2{
    public static void main(String[] args) {
        Thread thread = new Thread(new MyThread3());
        thread.setName("thread");
        thread.start();

//        Thread thread1 = new Thread(new MyThread3());
//        thread1.setName("thread1");
        Thread thread1 = new Thread(new MyThread3(),"thread1");
        thread1.start();

        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            throw new RuntimeException(e);
        }

        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"   9999");
        }
    }
}


class MyThread3 implements Runnable{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(Thread.currentThread().getName()+"   111111111111");
        }
    }
}